Method for Displaying View and Terminal Device

ABSTRACT

A method for displaying a view and a terminal device, where the method is applied to a terminal device on which a view control and at least one application are installed. The view control is a control in an operating system of the terminal device, and the method includes grouping multiple to-be-displayed objects in a first application using the view control, allocating a group identifier to each group, establishing mapping relationships between objects in each group and the group identifier of the group, generating, using the view control, a view comprising all the group identifiers and the multiple objects, displaying at least a part of the view, and preferentially displaying an object corresponding to a first group identifier when receiving a selection instruction for the first group identifier.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a U.S. National Stage of International PatentApplication No. PCT/CN2015/077521 filed on Apr. 27, 2015, which ishereby incorporated by reference in its entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate to the field of computertechnologies, and in particular, to a method for displaying a view and aterminal device.

BACKGROUND

A ListView control is used to sort multiple to-be-displayed objects inan application to generate a view, and display some objects in the viewon a terminal device. The ListView control can respond to an operationinstruction of a tap or slide event. For example, after receiving anoperation instruction triggered by a tap or slide, the ListView controlupdates the displayed view. In this way, a user may find a target objectusing a tap or slide operation instruction. When the method is used togenerate a view, if there are many objects, it is very time-consumingfor a terminal device to find a target object.

To resolve the foregoing problem, an alphabetical sorting control isdefined in a contact application. The alphabetical sorting control cansort multiple to-be-displayed contacts in the contact applicationaccording to initial letters of personal names, and generate a viewusing the ListView. In addition, the view further includes 26 presetletters (from A to Z). When a user triggers any letter of the 26letters, a user interface of the contact application displays a contactwhose initial letter is the letter.

However, in the foregoing solution, the alphabetical sorting control isbased on a single application. In other words, only objects in anapplication including the alphabetical sorting control can be sortedaccording to initial letters to generate a view. Therefore, theapplication scope of the foregoing solution is relatively narrow.

SUMMARY

Embodiments of the present disclosure provide a method for displaying aview and a terminal device in order to generate a view using a viewcontrol in an operating system and display the view to expand theapplication scope of the method for displaying a view and the terminaldevice.

To achieve the foregoing objective, the following technical solutionsare used in the embodiments of the present disclosure.

According to a first aspect, a method for displaying a view is provided,where the method is applied to a terminal device on which a view controland at least one application are installed, the view control is acontrol in an operating system of the terminal device, and the methodincludes grouping multiple to-be-displayed objects in a firstapplication using the view control, where the first application is anyapplication of the at least one application, allocating a groupidentifier to each group, establishing mapping relationships betweenobjects in each group and the group identifier of the group, generating,using the view control, a view including all the group identifiers andthe multiple objects, displaying at least a part of the view, andpreferentially displaying an object corresponding to the first groupidentifier when receiving a selection instruction for a first groupidentifier, where the first group identifier is any group identifier ofall the group identifiers.

With reference to the first aspect, in a first possible implementationmanner, grouping multiple to-be-displayed objects in a first applicationusing the view control includes sorting the multiple to-be-displayedobjects in the first application using the view control, and groupingthe multiple sorted objects.

With reference to the first possible implementation manner of the firstaspect, in a second possible implementation manner, grouping themultiple sorted objects includes grouping the multiple sorted objectsaccording to a sorting attribute of the sorting.

With reference to the second possible implementation manner of the firstaspect, in a third possible implementation manner, grouping the multiplesorted objects according to a sorting attribute of the sorting includesgrouping the multiple sorted objects according to a charactercorresponding to each object when a type of the sorting attribute of thesorting is a character string type, or grouping the multiple sortedobjects according to a value corresponding to each object when a type ofthe sorting attribute of the sorting is a value type.

With reference to the first possible implementation manner of the firstaspect, in a fourth possible implementation manner, grouping themultiple sorted objects includes grouping the multiple sorted objectsaccording to a preset quantity, where each group includes a presetquantity of objects.

With reference to the first aspect or any possible implementation mannerof the first aspect above, in a fifth possible implementation manner,grouping multiple to-be-displayed objects in a first application usingthe view control includes grouping the multiple objects using the viewcontrol when a quantity of the multiple to-be-displayed objects in thefirst application is greater than or equal to a preset threshold.

According to a second aspect, a terminal device is provided, where aview control and at least one application are installed on the terminaldevice, the view control is a control in an operating system of theterminal device, and the terminal device includes a grouping unitconfigured to group multiple to-be-displayed objects in a firstapplication using the view control, where the first application is anyapplication of the at least one application, an allocation unitconfigured to allocate a group identifier to each group, anestablishment unit configured to establish mapping relationships betweenobjects in each group and the group identifier of the group, ageneration unit configured to generate, using the view control, a viewincluding all the group identifiers and the multiple objects, a displayunit configured to display at least a part of the view, and a receivingunit configured to receive a selection instruction for a first groupidentifier, where the first group identifier is any group identifier ofall the group identifiers, and the display unit is further configured topreferentially display an object corresponding to the first groupidentifier when the receiving unit receives the selection instructionfor the first group identifier.

With reference to the second aspect, in a first possible implementationmanner, the grouping unit includes a sorting subunit configured to sortthe multiple to-be-displayed objects in the first application using theview control, and a grouping subunit configured to group the multiplesorted objects.

With reference to the first possible implementation manner of the secondaspect, in a second possible implementation manner, the grouping subunitis further configured to group the multiple sorted objects according toa sorting attribute of the sorting.

With reference to the second possible implementation manner of thesecond aspect, in a third possible implementation manner, the groupingsubunit is further configured to group the multiple sorted objectsaccording to a character corresponding to each object when a type of thesorting attribute of the sorting is a character string type, or groupthe multiple sorted objects according to a value corresponding to eachobject when a type of the sorting attribute of the sorting is a valuetype.

With reference to the first possible implementation manner of the secondaspect, in a fourth possible implementation manner, the grouping subunitis further configured to group the multiple sorted objects according toa preset quantity, where each group includes a preset quantity ofobjects.

With reference to the second aspect or any possible implementationmanner of the second aspect above, in a fifth possible implementationmanner, the grouping unit is further configured to group the multipleobjects using the view control when a quantity of the multipleto-be-displayed objects in the first application is greater than orequal to a preset threshold.

According to a third aspect, a terminal device is provided, where a viewcontrol and at least one application are installed on the terminaldevice, the view control is a control in an operating system of theterminal device, and the terminal device includes a memory, a processor,a display, and an input apparatus, where the memory is configured tostore a set of program code, where the program code is used to controlthe processor to execute the following operations grouping multipleto-be-displayed objects in a first application using the view control,where the first application is any application of the at least oneapplication, allocating a group identifier to each group, establishingmapping relationships between objects in each group and the groupidentifier of the group, and generating, using the view control, a viewincluding all the group identifiers and the multiple objects. Thedisplay is configured to display at least a part of the view. The inputapparatus is configured to receive a selection instruction for a firstgroup identifier, where the first group identifier is any groupidentifier of all the group identifiers, and the display is furtherconfigured to preferentially display an object corresponding to thefirst group identifier when the input apparatus receives the selectioninstruction for the first group identifier.

With reference to the third aspect, in a first possible implementationmanner, the processor is further configured to sort the multipleto-be-displayed objects in the first application using the view control,and group the multiple sorted objects.

With reference to the first possible implementation manner of the thirdaspect, in a second possible implementation manner, the processor isfurther configured to group the multiple sorted objects according to asorting attribute of the sorting.

With reference to the second possible implementation manner of the thirdaspect, in a third possible implementation manner, the processor isfurther configured to group the multiple sorted objects according to acharacter corresponding to each object when a type of the sortingattribute of the sorting is a character string type, or group themultiple sorted objects according to a value corresponding to eachobject when a type of the sorting attribute of the sorting is a valuetype.

With reference to the first possible implementation manner of the thirdaspect, in a fourth possible implementation manner, the processor isfurther configured to group the multiple sorted objects according to apreset quantity, where each group includes a preset quantity of objects.

With reference to the third aspect and the first possible implementationmanner to the fourth possible implantation manner of the third aspect,in a fifth possible implementation manner, the processor is furtherconfigured to group the multiple objects using the view control when aquantity of the multiple to-be-displayed objects in the firstapplication is greater than or equal to a preset threshold.

In the foregoing technical solution, a terminal device groupsto-be-displayed objects in a first application using a view control inan operating system, allocates a group identifier to each group,establishes mapping relationships between objects in each group and thegroup identifier corresponding to the group in order to generate a viewincluding all the group identifiers and the multiple objects, displaysat least a part of the view, and preferentially displays an objectcorresponding to the first group identifier when receiving a selectioninstruction for a first group identifier. In this way, when a user needsto search for and select a target object, the user may rapidly determinea general range of the target object by selecting a group identifier inorder to search for the target object within the range, therebyimproving a rate of searching for the target object. In addition, theview control in this solution is a control in the operating system, andtherefore can generate a view for every application installed on theterminal device. Compared with the other approaches in which a controlbased on an application generates a view for an object in theapplication, this solution can expand the application scope.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of the presentdisclosure more clearly, the following briefly describes theaccompanying drawings required for describing the embodiments. Theaccompanying drawings in the following description show merely someembodiments of the present disclosure, and a person of ordinary skill inthe art may still derive other drawings from these accompanying drawingswithout creative efforts.

FIG. 1 is a schematic flowchart of a method for displaying a viewaccording to an embodiment of the present disclosure;

FIG. 2 is a schematic flowchart of another method for displaying a viewaccording to an embodiment of the present disclosure;

FIG. 3 is a schematic flowchart of another method for displaying a viewaccording to an embodiment of the present disclosure;

FIG. 4 is a schematic structural diagram of a terminal device accordingto an embodiment of the present disclosure;

FIG. 5 is a schematic structural diagram of another terminal deviceaccording to an embodiment of the present disclosure; and

FIG. 6 is a schematic structural diagram of another terminal deviceaccording to an embodiment of the present disclosure.

DESCRIPTION OF EMBODIMENTS

The following clearly describes the technical solutions in theembodiments of the present disclosure with reference to the accompanyingdrawings in the embodiments of the present disclosure. The describedembodiments are merely some but not all the embodiments of the presentdisclosure. All other embodiments obtained by a person of ordinary skillin the art based on the embodiments of the present disclosure withoutcreative efforts shall fall within the protection scope of the presentdisclosure.

FIG. 1 shows a method for displaying a view according to an embodimentof the present disclosure. The method is applied to a terminal device onwhich a view control and at least one application are installed, theview control is a control in an operating system of the terminal device,and the method includes the following steps.

Step S101: Group multiple to-be-displayed objects in a first applicationusing the view control, where the first application is any applicationof the at least one application.

The “terminal device” may be a smart phone, a tablet computer, or thelike. The “operating system of the terminal device” may be an ANDROIDoperating system, a SYMBIAN operating system, a BLACKBERRY operatingsystem, or the like. The “view control” may be a list view control, agrid view control, a tree view control, or the like. The “application”may be an inherent application in the terminal device or may be athird-party application, for example, a contact application, a galleryapplication, a file management application, a music player application,or a social application. The “object” may be a text, an image, audio, avideo, or a folder. Objects in different applications may be the same ormay be different.

This embodiment of the present disclosure does not limit a condition oftriggering the terminal device to perform step S101. For example,performing may be triggered when an object in the first application isupdated, or may be triggered when an indication message of a user isreceived.

During specific implementation, the terminal device may further includean adapter. The adapter may be used as a bridge between applicationsinstalled on the terminal device and the view control in the operatingsystem of the terminal device, and configured to transmit multipleobjects in the applications and attributes of the objects (for example,a name and a creation time) to the view control such that the terminaldevice groups, using the view control, multiple to-be-displayed objectsin an application that are transmitted to the view control.

This embodiment of the present disclosure does not limit a specificgrouping manner in step S101. The grouping may be performed in anymanner in the other approaches, or may be performed in a grouping mannerprovided in the following description.

Optionally, in step S101, before grouping the multiple objects using theview control, the terminal device may obtain a quantity of the multipleto-be-displayed objects in the first application, and only when thequantity of the multiple to-be-displayed objects is greater than orequal to a preset threshold, the terminal device groups the multipleobjects using the view control.

This embodiment of the present disclosure does not limit a specificvalue of the “preset threshold,” which may be determined according to anactual requirement or a user indication, or may be preset in theterminal device according to an empirical value before delivery of theterminal device. The optional implementation manner can improve a rateof searching for a target object when there are a relatively largequantity of objects.

Step S102: Allocate a group identifier to each group, and establishmapping relationships between objects in each group and the groupidentifier of the group.

For example, the terminal device may allocate a group identifier to eachgroup according to a shared attribute of objects in the group. Forexample, when initial letters of names of objects in each group are all“h,” the letter “h” is used as a group identifier of the group. Foranother example, when creation times of objects in each group are allApril 2015, the April 2015 may be used as a group identifier of thegroup. Certainly, the terminal device may set a personalized groupidentifier of each group according to an actual requirement of a user.For example, the user may indicate a group identifier of each group tothe terminal device in a manner such as voice input or manual input.

Step S103: Generate, using the view control, a view including all thegroup identifiers and the multiple objects.

For example, the view generated by the view control includes all thegroup identifiers in step S102 and all the objects in step S101, and mayfurther include attributes of the objects and the like. For example,when the first application is a contact application, the “view” mayinclude all personal names of contacts in the contact application andgroup identifiers of all groups to which all the personal names of thecontacts belong, and may further include attributes of each object suchas a phone number and a home address.

Step S104: Display at least a part of the view.

For example, the terminal device may display, on a display of theterminal device, all the group identifiers and some objects of themultiple objects in the view, or may display, on a display of theterminal device, some group identifiers and some objects of the multipleobjects in the view.

It should be noted that, when there are a relatively small quantity ofgroup identifiers and objects, the terminal device may display theentire generated view, that is, the terminal device may display all thegroup identifiers and all the objects.

Step S105: When receiving a selection instruction for a first groupidentifier, preferentially display an object corresponding to the firstgroup identifier, where the first group identifier is any groupidentifier of all the group identifiers.

The “selection instruction” may include but not limited to a tapoperation instruction, a slide operation instruction, and the like. Itshould be noted that, after performing step S102, the terminal devicecan obtain objects corresponding to each group identifier.

Step S105 may be described as follows. When receiving a selectioninstruction for a first group identifier, preferentially display objectscorresponding to the first group identifier according to mappingrelationships between the first group identifier and objects in a groupcorresponding to the first group identifier.

For example, when receiving a selection instruction for a first groupidentifier, the terminal device may first display some or all objectscorresponding to the first group identifier, and after finish displayingall the objects corresponding to the first group identifier, display anobject corresponding to another group identifier.

Further, when the first group identifier corresponds to a relativelylarge quantity of objects, the terminal device may first display someobjects corresponding to the first group identifier, and continue todisplay another object corresponding to the first group identifier inresponse to a trigger operation of a user such as a slide operation or atap operation, and display an object corresponding to another groupidentifier after finish displaying all the objects corresponding to thefirst group identifier. When the first group identifier corresponds to arelatively small quantity of objects, the terminal device may firstdisplay all the objects corresponding to the first group identifier, anddisplay an object corresponding to another group identifier after finishdisplaying all the objects corresponding to the first group identifier.

According to the method for displaying a view provided in thisembodiment of the present disclosure, a terminal device groupsto-be-displayed objects in a first application using a view control inan operating system, allocates a group identifier to each group,establishes mapping relationships between objects in each group and thegroup identifier corresponding to the group in order to generate a viewincluding all the group identifiers and the multiple objects, displaysat least a part of the view, and preferentially displays an objectcorresponding to the first group identifier when receiving a selectioninstruction for a first group identifier. In this way, when a user needsto search for and select a target object, the user may rapidly determinea general range of the target object by selecting a group identifier inorder to search for the target object within the range, therebyimproving a rate of searching for the target object. In addition, theview control in this solution is a control in the operating system, andtherefore can generate a view for every application installed on theterminal device. Compared with the other approaches in which a controlbased on an application generates a view for an object in theapplication, this solution can expand the application scope.

In another method for displaying a view provided in an embodiment of thepresent disclosure, as shown in FIG. 2, on the basis of the embodimentshown in FIG. 1, step S101 may further include the foregoing steps.

Step S1011: Sort the multiple to-be-displayed objects in the firstapplication using the view control.

For example, step S1011 may include sorting, by the terminal deviceaccording to a sorting attribute of the multiple to-be-displayed objectsin the first application, the multiple objects using the view control.For example, when the “application” is a contact application, the“object” may be a contact, and the “sorting attribute” may be an initialcharacter of a personal name of a contact, an address name of a contact,or the like. For another example, when the “application” is a galleryapplication, the “object” may be an image, and the “sorting attribute”may be an initial character of a name of an image, a creation time of animage, a size of storage space occupied by an image, or the like. Forstill another example, when the “application” is a music playerapplication, the “object” may be a song, and the “sorting attribute” maybe an initial character of a name of a song, a personal name of a singercorresponding to a song, a size of storage space occupied by a song, orthe like.

This embodiment of the present disclosure does not limit a manner of the“sorting.” For example, when the “object” is an image, if the “sortingattribute” is a size of storage space occupied by an image, a manner ofthe “sorting” may be a descending order, or may be an ascending order.For another example, when the “object” is a contact, if the “sortingattribute” is an initial character of a personal name of a contact, amanner of the “sorting” may be an order from A (or a) to Z (or z)according to an initial letter of a name of a contact, or may be anorder from Z (or z) to A (or a). Other examples are not listed hereinone by one.

It should be noted that, when “first characters” of some objects arenumbers or other characters instead of letters (such as “?” and “*”),these objects may be arranged before or behind all objects whose initialcharacters are letters. In this case, when subsequent steps areperformed, these objects may be grouped into one or more groups, andgroup identifiers are allocated.

Step S1012: Group the multiple sorted objects.

In an implementation manner of this embodiment, the multiple sortedobjects are grouped according to a sorting attribute of the sorting,which may further include grouping the multiple sorted objects accordingto a character corresponding to each object when a type of the sortingattribute of the sorting is a character string type, or grouping themultiple sorted objects according to a value corresponding to eachobject when a type of the sorting attribute of the sorting is a valuetype. Refer to the following description for specific examples.

In another implementation manner of this embodiment, the multiple sortedobjects are grouped according to a preset quantity, where each groupincludes a preset quantity of objects. The preset quantity correspondingto each group may be a specific value, a value range, an algebraicexpression for calculating the quantity, or the like. For example, thealgebraic expression may be W÷N, where W denotes a quantity of themultiple objects and N denotes a quantity of group identifiers. Duringspecific implementation, N may be determined according to an actualrequirement or an empirical value. In addition, in this implementationmanner, preset quantities corresponding to different groups may be thesame or may be different.

FIG. 3 shows another method for displaying a view according to anembodiment of the present disclosure. The method includes the followingsteps.

Step S301: A terminal device determines whether multiple to-be-displayedobjects in a first application are sorted.

If not, step S302 is performed. If yes, step S303 is performed.

Step S302: Sort the multiple objects using a view control in anoperating system.

Step S303: Determine whether a quantity of the multiple objects isgreater than or equal to a preset threshold.

If not, the process ends. If yes, step S304 is performed.

It should be noted that, during specific implementation, the terminaldevice may first determine whether the quantity of the multiple objectsis greater than the preset threshold, and sort the multiple objectsusing the view control in the operating system when the quantity of themultiple objects is greater than the preset threshold. Then step S304 isperformed.

Step S304: Determine whether a type of a sorting attribute of thesorting is a character string type or a value type. The “value type” mayinclude a float value type or an integer type.

If the type of the sorting attribute of the sorting is a characterstring type, step S305 is performed. If the type of the sortingattribute of the sorting is a value type, step S306 is performed.

The “type of the sorting attribute” may be distinguished according to anactual situation, or may be determined according to experience. Forexample, the “sorting attribute” is a name, then when names of amajority of objects are character strings (including a pinyin, anEnglish name, a Chinese character, and the like), the “type of thesorting attribute” is a character string type, and when names of amajority of objects are numbers (for example, using a number as a nameof an image), the “type of the sorting attribute” is a value type. Foranother example, the “sorting attribute” is a personal name, then it maybe considered, according to experience, that the “type of the sortingattribute” is a character string type. For still another example, the“sorting attribute” is a creation time or a size of occupied storagespace, then it may be considered, according to experience, that the“type of the sorting attribute” is a value type.

Step S305: Group the multiple sorted objects according to a charactercorresponding to each object. Step S307 is performed after step S305 isperformed.

EXAMPLE 1

When the “sorting attribute” is a personal name, a name, or the like,the multiple sorted objects may be grouped according to an initialcharacter of a personal name or a name. For example, objects whoseinitial characters are a same letter (which may be any letter from A (ora) to Z (or z)) are grouped into one group, objects whose initialcharacters are numbers are grouped into one group, and objects whoseinitial characters are other characters are grouped into one group.

Step S306: Group the multiple sorted objects according to a valuecorresponding to each object. Step S307 is performed after step S306 isperformed.

EXAMPLE 2

When the “sorting attribute” is a creation time, the terminal device maygroup the multiple sorted objects according to a month or a year of acreation time. For example, objects whose creation times are in a samemonth are grouped into one group.

EXAMPLE 3

When the “sorting attribute” is a size of occupied storage space, theterminal device may group the multiple sorted objects according tovalues of sizes of storage space occupied by the multiple objects. Forexample, sizes of storage space occupied by 100 objects range from 3.00megabytes (MB) to 13.00 MB, and then the objects may be grouped in thefollowing manner grouping objects that occupies storage space whosesizes range from 3.00 MB to 4.00 MB into one group, grouping objectsthat occupies storage space whose sizes range from 4.00 M to 5.00 M intoone group, and so on such that the objects are grouped into 10 groups.

Step S307: Allocate a group identifier to each group, and establishmapping relationships between objects in each group and the groupidentifier of the group.

During specific implementation, a group identifier may be any value orcharacter string or the like that can be used to distinguish differentgroups. For example, based on the foregoing Example 1, A may be used asa group identifier of a group to which objects whose initial charactersare A (or a) belong, and other letters are similar thereto, and “#” maybe used as a group identifier of a group to which objects whose initialcharacters are numbers belong. Based on the foregoing Example 2, whenthe grouping is performed according to a month of a creation time, theterminal device may use a month of creation times of objects in eachgroup as a group identifier of the group. Based on the foregoing Example3, the terminal device may use a range of a size of storage spaceoccupied by objects in each group as a group identifier of the group.

Step S308: Generate, using the view control, a view including all thegroup identifiers and the multiple objects.

Step S309: Display at least a part of the view.

Step S310: When receiving a selection instruction for a first groupidentifier, preferentially display an object corresponding to the firstgroup identifier, where the first group identifier is any groupidentifier of all the group identifiers.

It should be noted that, compared with the solution in the otherapproaches, the technical solution provided in this embodiment in whichto-be-displayed objects in an application are sorted according toinitial letters to generate and display a view has a relatively lowrequirement on an application. Further, even if the application does notinclude a control for sorting, the technical solution provided in thisembodiment of the present disclosure can be used as long as theoperating system of the terminal device includes the view control.

FIG. 4 shows a terminal device 4 provided in an embodiment of thepresent disclosure. The terminal device 4 is configured to execute themethods for displaying a view provided above. For explanations ofrelated content in this embodiment, refer to the foregoing methodembodiments. Details are not described herein again.

A view control and at least one application are installed on theterminal device 4, the view control is a control in an operating systemof the terminal device 4, and the terminal device 4 includes a groupingunit 41 configured to group multiple to-be-displayed objects in a firstapplication using the view control, where the first application is anyapplication of the at least one application, an allocation unit 42configured to allocate a group identifier to each group, anestablishment unit 43 configured to establish mapping relationshipsbetween objects in each group and the group identifier of the group, ageneration unit 44 configured to generate, using the view control, aview including all the group identifiers and the multiple objects, adisplay unit 45 configured to display at least a part of the view, and areceiving unit 46 configured to receive a selection instruction for afirst group identifier, where the first group identifier is any groupidentifier of all the group identifiers, and the display unit 45 isfurther configured to preferentially display an object corresponding tothe first group identifier when the receiving unit 46 receives theselection instruction for the first group identifier.

Optionally, the grouping unit 41 is further configured to group themultiple objects using the view control when a quantity of the multipleto-be-displayed objects in the first application is greater than orequal to a preset threshold.

Optionally, as shown in FIG. 5, the grouping unit 41 includes a sortingsubunit 411 configured to sort the multiple to-be-displayed objects inthe first application using the view control, and a grouping subunit 412configured to group the multiple sorted objects.

In an implementation manner, the grouping subunit 412 is furtherconfigured to group the multiple sorted objects according to a sortingattribute of the sorting.

In this implementation manner, optionally, the grouping subunit 412 isfurther configured to group the multiple sorted objects according to acharacter corresponding to each object when a type of the sortingattribute of the sorting is a character string type, or group themultiple sorted objects according to a value corresponding to eachobject when a type of the sorting attribute of the sorting is a valuetype.

In another implementation manner, the grouping subunit 412 is furtherconfigured to group the multiple sorted objects according to a presetquantity, where each group includes a preset quantity of objects.

In a hardware implementation, the grouping unit 41, the allocation unit42, the establishment unit 43, and the generation unit 44 may be storedin a memory in a software form such that a processor invokes the unitsto execute operations corresponding to the units. The processor may be acentral processing unit (CPU), a microprocessor, a single-chipmicrocomputer, or the like. The display unit 45 may be a display. Thereceiving unit 46 may be an input apparatus, for example, a touchscreen.

FIG. 6 shows a terminal device 6 provided in an embodiment of thepresent disclosure. The terminal device 6 is configured to execute themethods for displaying a view provided above. For explanations ofrelated content in this embodiment, refer to the foregoing methodembodiments. Details are not described herein again.

A view control and at least one application are installed on theterminal device 6, the view control is a control in an operating systemof the terminal device 6, and the terminal device 6 includes a memory61, a processor 62, a display 63, an input apparatus 64, and a bussystem 65.

The memory 61, the processor 62, the display 63, and the input apparatus64 are coupled together using the bus system 65. The bus system 65 maybe an industry standard architecture (ISA) bus, a peripheral componentinterconnect (PCI) bus, an extended ISA (EISA) bus, or the like. The bussystem 65 may include an address bus, a data bus, a control bus, and thelike. For ease of representation, the bus system 65 in FIG. 6 isrepresented using only one bold line, but it does not indicate thatthere is only one bus or only one type of bus.

The memory 61 is configured to store a set of program code, where theset of program code includes program code of the operating system andapplication program code of the at least one application, and theprogram code of the operating system may include program code of theview control. The program code is used to control the processor 62 toexecute the operations of grouping multiple to-be-displayed objects in afirst application using the view control, where the first application isany application of the at least one application, allocating a groupidentifier to each group, establishing mapping relationships betweenobjects in each group and the group identifier of the group, andgenerating, using the view control, a view including all the groupidentifiers and the multiple objects. The display 63 is configured todisplay at least a part of the view. The input apparatus 64 isconfigured to receive a selection instruction for a first groupidentifier, where the first group identifier is any group identifier ofall the group identifiers, and the display 63 is further configured topreferentially display an object corresponding to the first groupidentifier when the input apparatus 64 receives the selectioninstruction for the first group identifier.

Optionally, the processor 62 is further configured to group the multipleobjects using the view control when a quantity of the multipleto-be-displayed objects in the first application is greater than orequal to a preset threshold.

Optionally, the processor 62 is further configured to sort the multipleto-be-displayed objects in the first application using the view control,and group the multiple sorted objects.

In an implementation manner, the processor 62 is further configured togroup the multiple sorted objects according to a sorting attribute ofthe sorting.

In this implementation manner, optionally, the processor 62 is furtherconfigured to group the multiple sorted objects according to a charactercorresponding to each object when a type of the sorting attribute of thesorting is a character string type, or group the multiple sorted objectsaccording to a value corresponding to each object when a type of thesorting attribute of the sorting is a value type.

In another implementation manner, the processor 62 is further configuredto group the multiple sorted objects according to a preset quantity,where each group includes a preset quantity of objects.

The terminal device 6 provided in this embodiment of the presentdisclosure groups to-be-displayed objects in a first application using aview control in an operating system, allocates a group identifier toeach group, establishes mapping relationships between objects in eachgroup and the group identifier corresponding to the group in order togenerate a view including all the group identifiers and the multipleobjects, displays at least a part of the view, and preferentiallydisplays an object corresponding to the first group identifier whenreceiving a selection instruction for a first group identifier. In thisway, when a user needs to search for and select a target object, theuser may rapidly determine a general range of the target object byselecting a group identifier in order to search for the target objectwithin the range, thereby improving a rate of searching for the targetobject. In addition, the view control in this solution is a control inthe operating system, and therefore can generate a view for everyapplication installed on the terminal device. Compared with the otherapproaches in which a control based on an application generates a viewfor an object in the application, this solution can expand theapplication scope.

It may be clearly understood by a person skilled in the art that, forthe purpose of convenient and brief description, for a detailed workingprocess of the foregoing system, apparatus, and unit, reference may bemade to a corresponding process in the foregoing method embodiments, anddetails are not described herein.

In the several embodiments provided in this application, it should beunderstood that the disclosed system, apparatus, and method may beimplemented in other manners. For example, the described apparatusembodiment is merely exemplary. For example, the unit division is merelylogical function division and may be other division in actualimplementation. For example, a plurality of units or components may becombined or integrated into another system, or some features may beignored or not performed. In addition, the displayed or discussed mutualcouplings or direct couplings or communication connections may beimplemented using some interfaces. The indirect couplings orcommunication connections between the apparatuses or units may beimplemented in electronic, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,may be located in one position, or may be distributed on a plurality ofnetwork units. Some or all the units may be selected according to actualrequirements to achieve the objectives of the solutions of theembodiments. Some or all the units may be selected according to actualrequirements to achieve the objectives of the solutions of theembodiments.

In addition, functional units in the embodiments of the presentdisclosure may be integrated into one processing unit, or each of theunits may exist alone physically, or two or more units are integratedinto one unit. The integrated unit may be implemented in a form ofhardware, or may be implemented in a form of hardware in addition to asoftware functional unit.

When the foregoing integrated unit is implemented in a form of asoftware functional unit, the integrated unit may be stored in acomputer-readable storage medium. The software functional unit is storedin a storage medium and includes several instructions for instructing acomputer device (which may be a personal computer, a server, or anetwork device) to perform some of the steps of the methods described inthe embodiments of the present disclosure. The foregoing storage mediumincludes any medium that can store program code, such as a universalserial bus (USB) flash drive, a removable hard disk, a read-only memory(ROM), a random access memory (RAM), a magnetic disk, or an opticaldisc.

Finally, it should be noted that the foregoing embodiments are merelyintended for describing the technical solutions of the presentdisclosure but not for limiting the present disclosure. Although thepresent disclosure is described in detail with reference to theforegoing embodiments, persons of ordinary skill in the art shouldunderstand that they may still make modifications to the technicalsolutions described in the foregoing embodiments or make equivalentreplacements to some technical features thereof, without departing fromthe spirit and scope of the technical solutions of the embodiments ofthe present disclosure.

1. A method for displaying a view, applied to a terminal device on whicha view control and at least one application are installed, wherein theview control is a control in an operating system of the terminal device,and wherein the method comprises: grouping a plurality ofto-be-displayed objects in a first application using the view control,wherein the first application is any application of the at least oneapplication; allocating a group identifier to each group; establishingmapping relationships between objects in each group and a groupidentifier of a corresponding group; generating, using the view control,a view comprising all group identifiers and the plurality ofto-be-displayed objects; displaying at least a part of the view; andpreferentially displaying an object corresponding to a first groupidentifier when receiving a selection instruction for the first groupidentifier, wherein the first group identifier is any group identifierof all the group identifiers.
 2. The method according to claim 1,wherein grouping the plurality of to-be-displayed objects comprises:sorting the plurality of to-be-displayed objects in the firstapplication using the view control; and grouping the sorted plurality ofto-be-displayed objects.
 3. The method according to claim 2, whereingrouping the sorted plurality of to-be-displayed objects comprisesgrouping the sorted plurality of to-be-displayed objects according to asorting attribute.
 4. The method according to claim 3, wherein groupingthe sorted plurality of to-be-displayed objects according to the sortingattribute comprises: grouping the sorted plurality of to-be-displayedobjects according to a character corresponding to each object when atype of the sorting attribute is a character string type; and groupingthe sorted plurality of to-be-displayed objects according to a valuecorresponding to each object when the type of the sorting attribute is avalue type.
 5. The method according to claim 2, wherein grouping theplurality of sorted objects comprises grouping the sorted plurality ofto-be-displayed objects according to a preset quantity, and wherein eachgroup comprises a preset quantity of objects.
 6. The method according toclaim 1, wherein grouping the plurality of to-be-displayed objectscomprises grouping the plurality of to-he-displayed objects using theview control when a quantity of the plurality of to-be-displayed objectsin the first application is greater than a preset threshold. 7.-12.(canceled)
 13. A terminal device, wherein a view control and at leastone application are installed on the terminal device, wherein the viewcontrol is a control in an operating system of the terminal device, andwherein the terminal device comprises: a memory; a processor; a display;and an input apparatus, wherein the memory, the processor, the display,and the input apparatus are coupled to each other using a bus, whereinthe memory is configured to store a set of program code, wherein the setof program code causes the processor to be configured to: group aplurality of to-be-displayed objects in a first application using theview control, wherein the first application is any application of the atleast one application; allocate a group identifier to each group;establish mapping relationships between objects each group and a groupidentifier of a corresponding group; and generate, using the viewcontrol, a view comprising all group identifiers and the plurality ofto-be-displayed objects, wherein the display is configured to display atleast a part of the view, wherein the input apparatus is configured toreceive a selection instruction for a first group identifier, whereinthe first group identifier is any group identifier of all the groupidentifiers, and wherein the display is further configured topreferentially display an object corresponding to the first groupidentifier when the input apparatus receives the selection instructionfor the first group identifier.
 14. The terminal device according toclaim 13, wherein the set of program code further causes the processorto be configured to: sort the plurality of to-be-displayed objects inthe first application using the view control; and group the sortedplurality of to-be-displayed objects.
 15. The terminal device accordingto claim 14, wherein the set of program code further causes theprocessor to be configured to group the sorted plurality ofto-be-displayed objects according to a sorting attribute.
 16. Theterminal device according to claim 15, wherein the set of program codefurther causes the processor to be configured to: group the sortedplurality of to-be-displayed objects according to a charactercorresponding to each object when a type of the sorting attribute is acharacter string type; and group the sorted plurality of to-be-displayedobjects according to a value corresponding to each object when the typeof the sorting attribute is a value type.
 17. The terminal deviceaccording to claim 14, wherein the set of program code further causesthe processor to be configured to group the sorted plurality ofto-be-displayed objects according to a preset quantity, and wherein eachgroup comprises a preset quantity of objects.
 18. The terminal deviceaccording to claim 13, wherein the set of program code further causesthe processor to be configured to group the plurality of objects byusing the view control when a quantity of the plurality ofto-be-displayed objects in the first application is greater than apreset threshold.
 19. A non-transitory computer-readable storage mediumcomprising instructions, wherein when executed by a computer, cause thecomputer, on which a view control and at least one application areinstalled to carry out the steps of: grouping a plurality ofto-be-displayed objects in a first application using the view control,wherein the first application is any application of the at least oneapplication, and wherein the view control is a control in an operatingsystem of the computer; allocating a group identifier to each group;establishing mapping relationships between objects in each group and agroup identifier of a corresponding group; generating, using the viewcontrol, a view comprising all group identifiers and the plurality ofto-be-displayed objects; displaying at least a part of the view; andpreferentially displaying an object corresponding to a first groupidentifier when receiving a selection instruction for the first groupidentifier, and wherein the first group identifier is any groupidentifier of all the group identifiers.
 20. The non-transitorycomputer-readable storage medium according to claim 19, wherein theinstructions further cause the computer to carry out the steps of:sorting the plurality of to-be-displayed objects in the firstapplication using the view control; and grouping the sorted plurality ofto-be-displayed objects according to a sorting attribute, and whereinwhen grouping the sorted plurality of to-be-displayed objects, theinstructions further cause the computer to carry out the steps of:grouping the sorted plurality of to-be-displayed objects according to acharacter corresponding to each object when a type of the sortingattribute is a character string type; and grouping the sorted pluralityof to-be-displayed objects according to a value corresponding to eachobject when the type of the sorting attribute is a value type.
 21. Thenon-transitory computer-readable storage medium according to claim 19,wherein the instructions further cause the computer to carry out thestep of grouping the plurality of to-be-displayed objects using the viewcontrol when a quantity of the plurality of to-be-displayed objects inthe first application is greater than a preset threshold.
 22. The methodaccording to claim 1, wherein grouping the plurality of to-the-displayedobjects comprises grouping the plurality of to-be-displayed objectsusing the view control when a quantity of the plurality ofto-be-displayed objects in the first application is equal to a presetthreshold.
 23. The terminal device according to claim 13, wherein theset of program code further causes the processor to be configured togroup the plurality of objects using the view control when a quantity ofthe plurality of to-be-displayed objects in the first application isequal to a preset threshold.
 24. The non-transitory computer-readablestorage medium according to claim 19, wherein the instructions furthercause the computer to carry out the step of grouping the plurality ofto-be-displayed objects using the view control when a quantity of theplurality of to-be-displayed objects in the first application is equalto a preset threshold.